<template>
    <div class="content">
        <div class="left">
            <div class="picbox">
                <img src="@/assets/map.png" alt="">
            </div>

        </div>
        <div class="right">
            <div class="right-main-form">
                <div class="contact-container">
                    <h1>contact us</h1>

                    <form @submit.prevent="handleSubmit">
                        <div>
                            <label for="name">姓名:</label>
                            <input type="text" id="name" v-model="form.name" placeholder="请输入姓名" required />

                        </div>
                        <div>
                            <label for="phone">电话:</label>
                            <input type="text" id="phone" v-model="form.phone" placeholder="请输入电话" required />
                        </div>
                        <div>
                            <label for="email">邮箱:</label>
                            <input type="email" id="email" v-model="form.email" placeholder="请输入邮箱" required />
                        </div>
                        <div style="display: flex;justify-content: start;align-items: start;">
                            <label for="message">留言:</label>
                            <textarea id="message" v-model="form.message" placeholder="请输入留言" required></textarea>
                        </div>
                        <button type="submit">提交</button>
                        <div class="line"></div>
                    </form>

                    <div class="contact-info">
                        <p style="margin-bottom: 2rem;">地址: 上海市黄浦区马当路388号SOHO复兴广场A座23F, Building A, SOHO Fuxing Plaza,
                            388 Madang Rd., Huangpu
                            District, Shanghai</p>

                        <p>交通: 地铁10/13号线新天地站4号口</p>
                        <p>电话: 021-61032677</p>
                        <p>Q Q: 1051121099</p>
                        <p>邮箱: <a href="mailto:power@powerde.com">power@powerde.com</a></p>
                        <div class="BusinessBox">
                            <img src="@/assets/二维码.jpg" alt="">
                            <span>商务合作</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script setup>
import { reactive } from 'vue';

const form = reactive({
    name: '',
    phone: '',
    email: '',
    message: ''
});
const handleSubmit = (e) => {
    console.log("我被提交了", e);

}
</script>

<style lang="scss" scoped>
.content {
    display: flex;
    height: 848px;
    width: 100%;

    .left {
        width: 50%;
        // height: 100%;
        background: url('@/assets/bg (1).jpg') no-repeat;
        position: relative;
        // background-size: cover;

        .picbox {
            overflow: hidden;
            position: absolute;
            top: 244px;
            left: 315px;
            border-radius: 50%;

            img {
                transition: transform 0.6s ease;
                /* 添加平滑过渡效果 */
            }

            img:hover {
                transform: scale(1.3);
                /* 鼠标悬停时放大图片 */
            }
        }

    }

    .right {

        width: 50%;
        background: url('@/assets/bg (1).jpg') no-repeat;
        background-size: 150% 150%;
        background-position: 40.9rem -23.3rem;




        .right-main-form {
            width: 652px;
            height: 100%;
            background-color: white;
            display: flex;
            justify-content: center;


            .contact-container {
                max-width: 500px;
                margin: 0 auto;
                font-family: Arial, sans-serif;

                h1 {
                    display: inline-block;
                    width: 80%;
                    margin-top: 2rem;
                    text-align: center;
                    font-size: 2rem;
                    margin-bottom: 20px;
                }

                form {
                    display: flex;
                    flex-direction: column;


                    label {
                        display: inline;
                        margin: 10px 0 5px;
                        font-size: 1em;
                        width: 41px;
                        margin-right: 5px;
                    }

                    input,
                    textarea {
                        padding: 10px;
                        font-size: 1rem;
                        margin-bottom: 15px;
                        border: 1px solid #ccc;
                        border-radius: 4px;
                        outline: none;
                        width: 26rem;
                        background: #e4e4e4;

                        &:focus {
                            border-color: #333;
                        }
                    }

                    textarea {
                        height: 7rem;
                        margin-left: -0.3rem;
                        resize: none;
                    }

                    button {
                        padding: 10px;
                        font-size: 1em;
                        color: #fff;
                        background-color: #000;
                        border: none;
                        border-radius: 4px;
                        cursor: pointer;
                        transition: background-color 0.3s ease;
                        width: 6rem;
                        margin-left: 70%;

                        &:hover {
                            background-color: #444;
                        }
                    }

                    .line {
                        width: 100%;
                        border-bottom: 1px solid #6a6a6a;

                        height: 45px;
                    }
                }

                .contact-info {
                    margin-top: 30px;
                    font-size: 0.9em;
                    line-height: 1.6;
                    color: #333;
                    position: relative;

                    p {
                        color: #6a6a6a;
                        font-size: 1.16rem;
                    }

                    a {
                        color: #007bff;
                        text-decoration: none;


                    }

                    .BusinessBox {
                        position: absolute;
                        right: 0;
                        bottom: 0;
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        flex-direction: column;
                        /* 主轴垂直方向 */


                        img {
                            width: 80px;
                            height: 80px
                        }
                    }
                }
            }
        }
    }
}
</style>